﻿<UserControl x:Class="SfdClient.View.SettingsView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:sys="clr-namespace:System;assembly=mscorlib"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <UserControl.DataContext>
        <Binding Path="SettingsViewModel" Source="{StaticResource locator}"/>
    </UserControl.DataContext>
    <Grid Background="{DynamicResource mainBackgroundBrush}" >
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Grid Height="64">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="64"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Button Style="{DynamicResource Win8ButtonStyle}" Command="{Binding BackCommand}" Height="48" VerticalAlignment="Center"  HorizontalAlignment="Left" >
                <Image Source="{DynamicResource Back}" Height="48"/>
            </Button>
            <TextBlock TextWrapping="Wrap" Text="{Binding [SettingsView_Parametres], Source={StaticResource localizer}}" Style="{DynamicResource TitleStyle}" Grid.Column="1"/>
        </Grid>
        <Grid Grid.Row="1">
        	<Grid.RowDefinitions>
        		<RowDefinition Height="Auto"  	/>
                <RowDefinition Height="Auto"  	/>
                <RowDefinition Height="Auto"  	/>
				<RowDefinition Height="Auto"    />
			</Grid.RowDefinitions>
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="Auto"/>
				<ColumnDefinition Width="*"/>
			</Grid.ColumnDefinitions>
            <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" d:LayoutOverrides="Height" 
                       Style="{DynamicResource StandardStyle}" 
                       Text="{Binding [SettingsView_DemarrerAvecWindows], Source={StaticResource localizer}}"/>
            <CheckBox Grid.Column="1" VerticalAlignment="Center" IsChecked="{Binding IsStartingWithWindows}" Margin="5"/>

            <TextBlock Style="{DynamicResource StandardStyle}" Text="{Binding [SettingsView_MotifsDossiers], Source={StaticResource localizer}}" Grid.Row="1"/>
            <TextBox Text="{Binding DefaultExcludedFoldersPattern}" Grid.Row="1" Grid.Column="1" VerticalAlignment="Center" Margin="5"/>

            <TextBlock Style="{DynamicResource StandardStyle}" Text="{Binding [SettingsView_MotifsFichiers], Source={StaticResource localizer}}" Grid.Row="2"/>
            <TextBox Text="{Binding DefaultExcludedFilesPattern}" Grid.Row="2" Grid.Column="1" VerticalAlignment="Center" Margin="5"/>

            <TextBlock Style="{DynamicResource StandardStyle}" Text="{Binding [SettingsView_TailleMax], Source={StaticResource localizer}}" Grid.Row="3"/>
            <StackPanel Orientation="Horizontal"  Grid.Row="3" Grid.Column="1" VerticalAlignment="Center" Margin="5">
                <ComboBox Width="100" SelectedItem="{Binding DefaultFileMaxSize}">
                    <sys:Int32>1024</sys:Int32>
                    <sys:Int32>2048</sys:Int32>
                    <sys:Int32>5120</sys:Int32>
                    <sys:Int32>10240</sys:Int32>
                    <sys:Int32>51200</sys:Int32>
                </ComboBox>
                <TextBlock Text="{Binding [SettingsView_Kb], Source={StaticResource localizer}}" VerticalAlignment="Center" Margin="5"/>
            </StackPanel>
        </Grid>
        <!-- La barre d'outils-->
        <Border x:Name="border" Grid.Row="2" Background="Black" >
            <Grid x:Name="grid" Background="Black" Opacity="1" >
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>

                <StackPanel d:LayoutOverrides="Height" Orientation="Horizontal">
                    <!--Enregistrer-->
                    <Button
    					x:Name="btnSave" Style="{DynamicResource Win8ButtonStyle}"
    					Command="{Binding SaveCommand}" >
                        <StackPanel Orientation="Vertical">
                            <Image Source="{DynamicResource Save}" Height="48"/>
                            <TextBlock TextWrapping="Wrap" Foreground="White" Text="{Binding [SettingsView_Enregistrer], Source={StaticResource localizer}}" HorizontalAlignment="Center"/>
                        </StackPanel>
                    </Button>
                </StackPanel>
            </Grid>
        </Border>
    </Grid>
</UserControl>
